<template>
	<div>
        <input v-model="user" placeholder="输入用户名查询用户信息">
		<button @click="getUser">点击获取用户信息</button>
		<el-table :data="userInfo">
		  <el-table-column property="u_id" label="价格"></el-table-column>
		</el-table>
	</div>
</template>
 
<script>
//导入我们之前写的接口
export default {
	name: 'home',
	data() {
		return {
			userInfo: [{
				u_id:'',
			}],
			user: 'ww',
		}
	},
	mounted(){
			var data=new Date();
			var hour=data.toLocaleString();
			console.log(hour);
		},
	methods: {
        
		 getUser() {
		
			this.$http.get('http://localhost:8800/user/findById',{ params:{u_name:this.user}})
        .then((res)=>{
            console.log(res.data);
			this.userInfo=res.data
			console.log(this.userInfo[0].u_id*3)
        })
	},

}
}
</script>
 
<style>
</style>